package com.yizisu.playerlibrary.view.video_view.view

import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView
import com.yizisu.playerlibrary.IYzsPlayer
import com.yizisu.playerlibrary.view.video_view.helper.IPlayerHelper

/**
 * 视频总进度文本
 */
open class PlayerTotalDurationText @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : AppCompatTextView(
    context,
    attrs,
    defStyleAttr
), IPlayerHelper {


    override fun onTick(playerModel: IYzsPlayer.Model) {
        super.onTick(playerModel)
        text = playerModel.totalDurationText
    }

    override fun isNeedPlayerListener(): Boolean {
        return true
    }
}